package com.jsnkj.basic.dialog

import android.app.Activity
import android.app.Dialog
import android.os.Bundle
import android.view.View
import android.widget.EditText
import android.widget.TextView
import com.jsnkj.basic.R


class BindPayDialog(
    var dialogContext: Activity,
    var click: onItemClickListener
) : Dialog(dialogContext), View.OnClickListener {


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.dialog_bind_pay)
        setCanceledOnTouchOutside(true)
        setCancelable(true)
        window?.setBackgroundDrawableResource(android.R.color.transparent)


        findViewById<TextView>(R.id.tv_cancel).setOnClickListener(this)
        findViewById<TextView>(R.id.tv_bind).setOnClickListener(this)

    }

    interface onItemClickListener {
        fun itemClickResult(aliLoginId: String, realName: String)
    }

    override fun onClick(view: View) {
        dismiss()
        when (view.id) {
            R.id.tv_bind -> {
                val aliLoginId = findViewById<EditText>(R.id.et_account).text.toString()

                val realName = findViewById<EditText>(R.id.et_name).text.toString()

                click.itemClickResult(aliLoginId, realName)
            }
        }
    }
}






















